package com.sui.bigdata.rtcadmin.configuration;

import com.feidee.fdcommon.configuration.CustomConfiguration;
import com.sui.bigdata.rtcadmin.constant.AppConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @Author: TingWuHuang
 * @Date: 2020/5/6 15:30
 * @description
 */
@Component
public class InitConfig implements CommandLineRunner {
    private static final Logger logger = LoggerFactory.getLogger(InitConfig.class);

    @Override
    public void run(String... args) throws Exception {
        init();
    }

    public void init() {
        logger.info("init config>>>>>>>>>>");

        AppConstant.ENV = CustomConfiguration.getString("env");
        logger.info("env>>>>>>>>" + AppConstant.ENV);
        AppConstant.WEB_PREFIX = CustomConfiguration.getString("web.prefix", "http://icdev-244-8088.suishoushuju.net/proxy/");
        logger.info("web.prefix: " + AppConstant.WEB_PREFIX);


    }
}
